
ifeq (0,$(MAKELEVEL))
$(error You can not make this file directly. Please make it in build directory)
endif


VERSION_VAR=VERSION_MENU_STR
VERSION_VALUE=$(shell unixdate +%Y-%m-%d)

			

ifneq (,$(filter -DENABLE_NANDDRV,$(USERCFLAGS)))
CFLAGS += -I$(INCLUDE_DIR)/gui/controls \
		  -I$(INCLUDE_DIR)/gui/font     \
            -I./gui/$(WIN_DIR)         \
            -I./gui/$(EVENT_DIR_CUSTOM)  \
            -I./gui/$(RESOURCE_DIR)\
		  -I$(INCLUDE_DIR)/net \
		  -I./gui
else
CFLAGS += -I$(INCLUDE_DIR)/gui/controls \
		  -I$(INCLUDE_DIR)/gui/font     \
		  -I./gui/win -I$(INCLUDE_DIR)/net \
		  -I./gui
endif
SOURCES = main.c gui/aw_init_display.c \
	      gui/aw_user_init.c  gui/inputdev.c \
	      gui/logo_dat.c gui/aw_config.c \
	      gui/fs_playlist.c gui/scrsaver.c gui/i2c_communication.c  

ifneq (,$(filter -DENABLE_BLUETOOTH,$(USERCFLAGS)))
SOURCES += gui/aw_bluetooth.c 
endif

ifneq (,$(filter -DENABLE_NETWORK,$(USERCFLAGS)))
SOURCES += gui/aw_network.c gui/aw_sys_app_net.c gui/aw_netfs.c gui/aw_config_net.c 
endif

ifneq (,$(filter -DAML_DIR,$(USERCFLAGS)))
SOURCES += 		$(WINDIR)/win/FileTypeSelectEvent_Dir.c \
$(WINDIR)/win/logoEvent_Dir.c
else
SOURCES += 		$(WINDIR)/win/FileTypeSelectEvent.c \
$(WINDIR)/win/logoEvent.c
endif

WINDIR=gui
ifneq (,$(AMRES))
SOURCES += exres.c dummy.c
endif
ifeq (boot_loader_support,$(strip $(IS_BOOT_LOADER)))
BURNERSOURCE= $(wildcard burner/*.c) nand_start.c
SOURCES +=  out_parameter.c nand_start.c boot_check.c  img_upgrade_v2.c
endif

include gui/Makefile.source

ifneq (,$(filter -DTV_MODE_720P,$(USERCFLAGS)))
SOURCES += 	$(WINDIR)/win_720P/NetmenuSetup_720P.c \
$(WINDIR)/win_720P/Win15pic_720P.c \
$(WINDIR)/win_720P/WinPicInfoBar_720P.c \
$(WINDIR)/win_720P/DeviceSelect_720P.c \
$(WINDIR)/win_720P/FileTypeSelect_720P.c \
$(WINDIR)/win_720P/FileList_720P.c \
$(WINDIR)/win_720P/logo_720P.c \
$(WINDIR)/win_720P/MoviePlayBack_720P.c \
$(WINDIR)/win_720P/LoadingWin_720P.c \
$(WINDIR)/win_720P/WinConfirm_720P.c \
$(WINDIR)/win_720P/Divx_SubTitle_720P.c\
$(WINDIR)/win_720P/ScreenSaver_720P.c\
$(WINDIR)/win_720P/WinPeripheralDev_720P.c\
$(WINDIR)/win_720P/Debug_720P.c \
$(WINDIR)/resource/icon_data_720p.c
endif

ifneq (,$(filter -DTV_MODE_1080P,$(USERCFLAGS)))
SOURCES += 	$(WINDIR)/win_1080P/NetmenuSetup_1080P.c \
$(WINDIR)/win_1080P/Win15pic_1080P.c \
$(WINDIR)/win_1080P/WinPicInfoBar_1080P.c \
$(WINDIR)/win_1080P/DeviceSelect_1080P.c \
$(WINDIR)/win_1080P/FileTypeSelect_1080P.c \
$(WINDIR)/win_1080P/FileList_1080P.c \
$(WINDIR)/win_1080P/logo_1080P.c \
$(WINDIR)/win_1080P/MoviePlayBack_1080P.c \
$(WINDIR)/win_1080P/LoadingWin_1080P.c \
$(WINDIR)/win_1080P/WinConfirm_1080P.c \
$(WINDIR)/win_1080P/Divx_SubTitle_1080P.c\
$(WINDIR)/win_1080P/ScreenSaver_1080P.c\
$(WINDIR)/win_1080P/WinPeripheralDev_1080P.c\
$(WINDIR)/win_1080P/Debug_1080P.c \
$(WINDIR)/resource/icon_data_1080p.c
endif

ifneq (,$(filter -DENABLE_NANDDRV,$(USERCFLAGS)))
SOURCES += 	$(WINDIR)/aw_TXT_app_nand.c
endif

MYAPP = $(strip $(BASE_OUT_NAME)).out


libs =  apputil.lib  app_avi.lib    app_gplayer.lib \
	 app_vob.lib  app_pic.lib  app_system.lib  app_txt.lib \
	  zlib.lib  osd.lib  input.lib  gui.lib \
	 demux.lib  dma.lib\
	 chipsupport.lib  cardreader.lib \
	 dcf.lib  xml.lib \
	 usb_core.lib  usb_host.lib  usb_image.lib  usb_storage.lib \
		nand.lib \
	 usb_gadget.lib \
		 i2c.lib

LIBS+=$(libs:%.lib=-l%)	

include $(EXTERN_RELEASE_DIR)/makefiles/avos.app

